package com.cy.lib.redis.demo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cy.lib.redis.demo.dao.UserDao;
import com.cy.lib.redis.demo.domain.User;

@Service
public class UserService {
	
	@Autowired
	private UserDao dao;

	public void setDao(UserDao dao) {
		this.dao = dao;
	}
	
	public User saveUser(User user){
		return dao.saveUser(user);
	}
	
	public User findById(long id){
		return dao.findById(id);
	}
	
	public List<User> findByName(String name){
		return dao.findByName(name);
	}
	
	public List<User> findAll(){
		return dao.findAll();
	}
	
	public User updateUser(User user){
		return dao.updateUser(user);
	}
	
	public void deleteUser(User user){
		dao.delUser(user);
	}
}
